home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / os2 / killem.zip / PROCSTAT.H < prev    next >
Text File  |  1992-03-05  |  6KB  |  135 lines

  1. /**********************************************************************
  2.  * MODULE NAME :  procstat.h             AUTHOR:  Rick Fishman        *
  3.  * DATE WRITTEN:   2-10-92                                            *
  4.  *                                                                    *
  5.  * DESCRIPTION:                                                       *
  6.  *                                                                    *
  7.  *  This header file contains the function prototype for the asofyet  *
  8.  *  undocumented DosQProcStatus API.  It also contains the structure  *
  9.  *  definitions that are used in the buffer that is returned by the   *
  10.  *  API call.                                                         *
  11.  *                                                                    *
  12.  *  In order to invoke DosQProcStatus, your .DEF file must contain    *
  13.  *  this entry:                                                       *
  14.  *                                                                    *
  15.  *           IMPORTS DOSQPROCSTATUS=DOSCALLS.154                      *
  16.  *                                                                    *
  17.  **********************************************************************/
  18.  
  19. #pragma linkage( DosQProcStatus, far16 pascal )
  20. USHORT DosQProcStatus( PVOID pvBuf, USHORT cbBuf );
  21.  
  22. #define PROCESS_END_INDICATOR   3       // Indicates end of process structs
  23.  
  24. #pragma pack(1)
  25.  
  26. typedef struct _SUMMARY
  27. {
  28.     ULONG   ulThreadCount;              // Number of threads in system
  29.     ULONG   ulProcessCount;             // Number of processes in system
  30.     ULONG   ulModuleCount;              // Number of modules in system
  31.  
  32. } SUMMARY, *PSUMMARY;
  33.  
  34.  
  35. typedef struct _THREADINFO
  36. {
  37.     UCHAR   uchDontKnow1;               //
  38.     UCHAR   uchDontKnow2;               //
  39.     USHORT  usDontKnow3;                //
  40.     USHORT  tidWithinProcess;           // TID within process (TID is 4 bytes!!)
  41.     USHORT  tidWithinSystem;            // TID within system
  42.     ULONG   ulBlockId;                  // Block ID (?)
  43.     USHORT  usPriority;                 // Priority
  44.     USHORT  usDontKnow4;                //
  45.     USHORT  usDontKnow5;                //
  46.     USHORT  usDontKnow6;                //
  47.     USHORT  usDontKnow7;                //
  48.     USHORT  usDontKnow8;                //
  49.     USHORT  usThreadStatus;             // 2=blocked or ready, 5=running
  50.     USHORT  usDontKnow9;                //
  51.  
  52. } THREADINFO, *PTHREADINFO;
  53.  
  54.  
  55. typedef struct _PROCESSINFO
  56. {
  57.     ULONG       ulEndIndicator;         // 1 means not end, 3 means last entry
  58.     PTHREADINFO ptiFirst;               // Address of the 1st Thread Control Blk
  59.     USHORT      pid;                    // Process ID (2 bytes - PID is 4 bytes)
  60.     USHORT      pidParent;              // Parent's process ID
  61.     USHORT      usDontKnow2;            //
  62.     USHORT      usDontKnow3;            //
  63.     USHORT      usDontKnow4;            //
  64.     USHORT      usDontKnow5;            //
  65.     USHORT      idSession;              // Session ID
  66.     USHORT      usDontKnow6;            //
  67.     USHORT      hModRef;                // Module handle of EXE
  68.     USHORT      usThreadCount;          // Number of threads in this process
  69.     USHORT      usSessionType;          // Session type (SSF_TYPE_xx)
  70.     CHAR        achDontKnow7[ 6 ];      //
  71.     USHORT      usThreadIdCount;        // Number of USHORTs in Thread id table?
  72.     USHORT      usModCount;             // Number of USHORTs in ModHandle table?
  73.     USHORT      usUshortCount;          // Number of USHORTs in Ushort table?
  74.     USHORT      usDontKnow8;            //
  75.     ULONG       ulThreadIdTableAddr;    // Maybe the address of a TID table
  76.     ULONG       ulModHandleTableAddr;   // Address of a ModHandle table (DLLS?)
  77.     ULONG       ulUshortTableAddr;      // Address of a table of USHORTs (?)
  78.  
  79. } PROCESSINFO, *PPROCESSINFO;
  80.  
  81.  
  82. typedef struct _SEMINFO
  83. {
  84.     struct _SEMINFO *pNext;             // Ptr to next block (NULL on last one)
  85.     USHORT   idOwningThread;            // ID of owning thread?
  86.     USHORT   fsFlags;                   // (MSB-LSB)
  87.     UCHAR    uchReferenceCount;         // Number of references
  88.     UCHAR    uchRequestCount;           // Number of requests
  89.     CHAR     achDontKnow1[ 6 ];         //
  90.     USHORT   usIndex;                   // Index (?)
  91.     CHAR     szSemName[ 1 ];            // ASCIIZ semaphore name
  92.  
  93.  
  94. } SEMINFO, *PSEMINFO;
  95.  
  96. typedef struct _SHRMEMINFO
  97. {
  98.     struct _SHRMEMINFO *pNext;          // Ptr to next block (NULL on last one)
  99.     USHORT      usMemHandle;            // Shared memory handle (?)
  100.     SEL         selMem;                 // Selector
  101.     USHORT      usReferenceCount;       // Number of references
  102.     CHAR        szMemName[ 1 ];         // ASCIIZ shared memory name
  103.  
  104. } SHRMEMINFO, *PSHRMEMINFO;
  105.  
  106.  
  107. typedef struct _MODINFO
  108. {
  109.     struct _MODINFO *pNext;             // Ptr to next block (NULL on last one)
  110.     USHORT   hMod;                      // Module handle
  111.     USHORT   usModType;                 // Module type (0=16bit,1=32bit)
  112.     ULONG    ulModRefCount;             // Count of module references
  113.     ULONG    ulSegmentCount;            // Number of segments in module
  114.     ULONG    ulDontKnow1;               //
  115.     PSZ      szModName;                 // Addr of fully qualified module name
  116.     USHORT   usModRef[ 1 ];             // Handles of module references
  117.  
  118. } MODINFO, *PMODINFO;
  119.  
  120.  
  121. typedef struct _BUFFHEADER
  122. {
  123.        PSUMMARY        psumm;              // SUMMARY section ptr
  124.     PPROCESSINFO    ppi;                // PROCESS section ptr
  125.     PSEMINFO        psi;                // SEM section ptr (add 16 to offset)
  126.     PVOID           pDontKnow1;         //
  127.     PSHRMEMINFO     psmi;               // SHARED MEMORY section ptr
  128.     PMODINFO        pmi;                // MODULE section ptr
  129.     PVOID           pDontKnow2;         //
  130.     PVOID           pDontKnow3;         //
  131.  
  132. } BUFFHEADER, *PBUFFHEADER;
  133.  
  134. #pragma pack()
  135.